
{***********************************************************}
{                                                           }
{      Informix esql "ifxgls.h"                             }
{                                                           }
{      Translated to Object Pascal by                       }
{      Copyright (c) 2001-2008 Luxena Software Company      }
{      http://www.luxena.com                                }
{      e-mail: support@luxena.com                           }
{                                                           }
{***********************************************************}

unit IfxGls;

{$I lx.inc}

interface

uses
  LXTypes, IfxTypes;

type

  // The following defines determine whether gl_locale implies a session
  // locale or a db_locale/client_locale combination depending on server/client
  // initialisation.

{$IFDEF NT_MI_SAPI} // NT Server/Blade
{$IFDEF MI_SERVBUILD}
{$IFDEF NT_SERVER} // NT Server
{$ELSE} // NT Blade

  //* __declspec(dllimport) gl_lc_t ** mi_get_locale();
  //* #define gl_locale ** mi_get_locale()

{$ENDIF} // NT_SERVER
{$ENDIF} // MI_SERVBUILD

{$ELSE} //  UNIX/Win32 Client - Default

{$IFDEF MI_SERVBUILD}
  //* extern gl_lc_t *scb;
  //* #define gl_locale ( *scb)
{$ELSE}
{$IFDEF _WIN32}
  //* extern __declspec(dllimport) gl_lc_t gls_env;
{$ELSE}
  //* extern gl_lc_t gls_env;

{$ENDIF} // _WIN32
  //* #define gl_locale (gls_env)

{$ENDIF MI_SERVBUILD}
{$ENDIF NT_MI_SAPI}

  PConv_State = ^TConv_State;
  TConv_State = class
  end;

  PPgl_mchar = ^Pgl_mchar;
  Pgl_mchar = ^Tgl_mchar;
  Tgl_mchar = class
  end;

  PPByte = ^PByte;

(**
{$IFDEF __STDC__}

  // Locale initialisation function.
  Tifx_gl_init = function: mint; cdecl;


  // Codeset conversion functions.

  Tifx_gl_cv_mconv = function(state: PConv_State;
    dst: PPgl_mchar;
    dstbytes: Pmint;
    dst_codeset: PChar;
    src: PPgl_mchar;
    srcbytes: Pmint;
    src_codeset: PChar): mint; cdecl;


  Tifx_gl_cv_outbuflen = function(dst_codeset: PChar;
    src_codeset: PChar;
    srcbytes: mint): mint; cdecl; 


  Tifx_gl_conv_needed = function(dst_codeset: PChar;
    src_codeset: PChar): mint; cdecl;


  Tifx_gl_cv_sb2sb_table = function(dstcs: PChar;
    srccs: PChar;
    Array_: PPByte): mint; cdecl;


  // Built-in Data Type Conversion.

  Tifx_gl_convert_date = function(date: Pint4;
    datestr: PChar;
    format: PChar): mint; cdecl; 


  Tifx_gl_format_date = function(datestr: PChar;
    len: mint;
    date: PInt4;
    format: PChar): mint; cdecl;


  Tifx_gl_convert_datetime = function(datestr: PChar;
    dt: PDTime;
    datetimestr: PChar;
    format: PChar): mint; cdecl;


  Tifx_gl_format_datetime = function(datestr: PChar;
    len: mint;
    dt: PDTime;
    format: PChar): mint; cdecl;


  Tifx_gl_convert_double = function(d: PDouble;
    dstr: PChar;
    format: PChar): mint; cdecl;


  Tifx_gl_format_double = function(dstr: PChar;
    len: mint;
    d: Double;
    format: PChar): mint; cdecl;


  Tifx_gl_convert_money = function(mon: PDec;
    monstr: PChar;
    format: PChar): mint; cdecl;


  Tifx_gl_format_money = function(monstr: PChar;
    len: mint;
    mon: PDec;
    format: PChar): mint; cdecl;


  Tifx_gl_convert_number = function(dec: PDec;
    decstr: PChar;
    format: PChar): mint; cdecl;


  Tifx_gl_format_number = function(decstr: PChar;
    len: Integer;
    dec: PDec;
    format: PChar): mint; cdecl;

{$ELSE}
**)

  TIfx_gl_init = function: mint;
  TIfx_gl_cv_mconv = function: mint;
  TIfx_gl_cv_outbuflen = function: mint;
  TIfx_gl_conv_needed = function: mint;
  TIfx_gl_cv_sb2sb_table = function: mint;
  TIfx_gl_convert_date = function: mint;
  TIfx_gl_format_date = function: mint;
  TIfx_gl_convert_datetime = function: mint;
  TIfx_gl_format_datetime = function: mint;
  TIfx_gl_convert_double = function: mint;
  TIfx_gl_format_double = function: mint;
  TIfx_gl_convert_money = function: mint;
  TIfx_gl_format_money = function: mint;
  TIfx_gl_convert_number = function: mint;
  TIfx_gl_format_number = function: mint;

(**
{$ENDIF}
**)

implementation

end.